package com.ash.event;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextStartedEvent;

import com.ash.bean.HelloWorld;

public class IocStart implements ApplicationListener<ContextStartedEvent> {

    @Override
    public void onApplicationEvent(ContextStartedEvent event) {
        HelloWorld h = (HelloWorld) event.getApplicationContext().getBean("h");
        System.out.println(h.getUserName());
        System.out.println("context start...");
    }

}
